package com.gljx.web.service.impl;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.gljx.web.Entity.JournalEntry.CarExpenseDetailJournal;
import com.gljx.web.Entity.JournalEntry.lCarRefuelingJournal;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.gljx.web.Entity.CarRefuelEntry;
import com.gljx.web.dao.CarRefuelEntryMapper;
import com.gljx.web.service.CarRefuelEntryService;

@Service
@Transactional
public class CarRefuelEntryServiceImpl implements CarRefuelEntryService{

	@Autowired
	private CarRefuelEntryMapper carRefuelEntryMapper;
	
	
	@Override
	public Double selCarRefuelBeginBalance(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return carRefuelEntryMapper.selCarRefuelBeginBalance(map);
	}


	@Override
	public List<CarRefuelEntry> selCarRefuelEntry(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return carRefuelEntryMapper.selCarRefuelEntry(map);
	}


	@Override
	public Double selCarRefuelBeginBalances(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return carRefuelEntryMapper.selCarRefuelBeginBalances(map);
	}


	@Override
	public List<CarRefuelEntry> selCarRefuelEntryByParentId(String parentid, String carNumber) {
		// TODO Auto-generated method stub
		return carRefuelEntryMapper.selCarRefuelEntryByParentId(parentid, carNumber);
	}


	@Override
	public int deleteByParentId(String parentId) {
		// TODO Auto-generated method stub
		return carRefuelEntryMapper.deleteByParetnId(parentId);
	}

    @Override
    public List<lCarRefuelingJournal> selectofMonthAscarRefuelEntry(Map map) {
        return carRefuelEntryMapper.selectofMonth(map);
    }

	@Override
	public List<CarExpenseDetailJournal> selCarExpenseDetail(Map map, String state) {
		List<CarExpenseDetailJournal> re = new ArrayList<>();
		if ("0".equals(state)) {
			//查询明细表
			re = carRefuelEntryMapper.selectCarExpenseDetail2(map);
		} else {
			re = carRefuelEntryMapper.selectCarExpenseDetail(map);
		}
		return re;
	}


	@Override
	public List<CarRefuelEntry> selectCarRefuelEntryForJournal(Map<String, String> map3) {
		// TODO Auto-generated method stub
		return carRefuelEntryMapper.selectCarRefuelEntryForJournal(map3);
	}

}
